<?php
namespace app\admin\middleware;

use think\Response;

class middleware {
    public function handle($request,\Closure $next){
        if(!preg_match('/admin/',$request->pathinfo())){
            if(empty(session('admin_name'))){
                return redirect('/index.php?s=admin/admin/admin_list');
            }
        }
        $response = $next($request);
        return $response;
    }
    public function end(Response $response){

    }
}